//
//  LBViewController.m
//  LBHorizontalTextLoopView
//
//  Created by liuboliu on 09/20/2021.
//  Copyright (c) 2021 liuboliu. All rights reserved.
//

#import "LBViewController.h"
#import <LBHorizontalTextLoopView/LBHorizontalTextLoopView.h>

@interface LBViewController () <LBHorizontalTextLoopViewDelegate>

@property (nonatomic, strong) LBHorizontalTextLoopView *textLoopView;

@end

@implementation LBViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.textLoopView];
    [self.textLoopView loadWithContentArray:@[@"预计今年底通车，上海金山最后一条未通车省际道路已完成八成"]];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - LBHorizontalTextLoopViewDelegate
- (void)horizontalLoopViewdidSelectItemAtIndex:(NSInteger)index
{
    NSLog(@"点击点击点击点击%ld",(long)index);
}

#pragma mark - lazy load

- (LBHorizontalTextLoopView *)textLoopView
{
    if (!_textLoopView) {
        _textLoopView = [[LBHorizontalTextLoopView alloc] initWithFrame:CGRectMake(10, 100, 350, 40)];
        _textLoopView.backgroundColor = [UIColor cyanColor];
        _textLoopView.delegate = self;
        _textLoopView.textColor = [UIColor redColor];
        _textLoopView.font = [UIFont systemFontOfSize:18];
    }
    return _textLoopView;
}

@end
